package com.sip.stream.gbstack.Model;

import com.sip.stream.gbstack.GS28181SDKConfig;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class GS28181AlarmNotify {
    public String method;
    public String priority = "4";
    public String time = "";
    public String content = "";
    public int alarmType = 0;
    public int eventType = 1;
    public double longitude = 0.0d;
    public double latitude = 0.0d;
    public String extension = "";
    private String gbCode = null;

    public GS28181AlarmNotify(String method) {
        this.method = method;
    }

    public String getGbCode() {
        return this.gbCode;
    }

    public void setGbCode(String gbCode) {
        this.gbCode = gbCode;
    }

    public static class Builder {
        private GS28181AlarmNotify buildTarget;

        public Builder(String method) {
            this.buildTarget = new GS28181AlarmNotify(method);
        }

        public GS28181AlarmNotify build() {
            return this.buildTarget;
        }

        public Builder setPriority(String priority) {
            this.buildTarget.priority = priority;
            return this;
        }

        public Builder setCurrentTime() {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(GS28181SDKConfig.GS28181SDK_DATE_FORMAT, Locale.CHINA);
            this.buildTarget.time = simpleDateFormat.format(new Date());
            return this;
        }

        public Builder setTime(Date date) {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(GS28181SDKConfig.GS28181SDK_DATE_FORMAT, Locale.CHINA);
            this.buildTarget.time = simpleDateFormat.format(date);
            return this;
        }

        public Builder setAlarmType(int alarmType) {
            this.buildTarget.alarmType = alarmType;
            return this;
        }

        public Builder setEventType(int eventType) {
            this.buildTarget.eventType = eventType;
            return this;
        }

        public Builder setPostion(double longitude, double latitude) {
            this.buildTarget.longitude = longitude;
            this.buildTarget.latitude = latitude;
            return this;
        }

        public Builder setCachePostion(double longitude, double latitude) {
            this.buildTarget.longitude = longitude;
            this.buildTarget.latitude = latitude;
            return this;
        }

        public Builder setContent(String content) {
            this.buildTarget.content = content;
            return this;
        }

        public Builder setExtension(String extension) {
            this.buildTarget.extension = extension;
            return this;
        }
    }
}
